#include <iostream>
using namespace std;
class CBase 
{
private:
	int x;
	void showx() { cout << "CBase::x=" << x << endl; }
protected:
	int y;
	void showy() { cout << "CBase::y=" << y << endl; }
public:
	int z;
	void showz() { cout << "CBase::z=" << z << endl; }
	CBase(int t1, int t2, int t3) :x(t1), y(t2), z(t3) {}
	void showbasex() { showx(); }
};

class CDeriveA:private CBase
{
private:
	int ax;
	void showax() { cout << "CDeriveA::ax=" << ax << endl; }
protected:
	int ay;
	void showay() { cout << "CDeriveA::ay=" << ay << endl; }
public:
	int az;
	void showaz() { cout << "CDeriveA::az=" << az << endl; }
	CDeriveA(int t1, int t2, int t3, int t4, int t5, int t6) :CBase(t1,t2,t3),ax(t4), ay(t5), az(t6){}
	void showAxandBasexfromOuterA() { CBase::showbasex(); showax(); }
	void showAyandBaseyfromOuterA() { CBase::showy(); showay(); }
	void showAzandBasezfromOuterA() { CBase::showz(); showaz(); }
};

class CDeriveB:protected CBase
{
private:
	int bx;
	void showbx() { cout << "CDeriveB::bx=" << bx << endl; }
protected:
	int by;
	void showby() { cout << "CDeriveB::by=" << by << endl; }
public:
	int bz;
	void showbz() { cout << "CDeriveB::bz=" << bz << endl; }
	CDeriveB(int t1, int t2, int t3, int t4, int t5, int t6) :CBase(t1, t2, t3), bx(t4), by(t5), bz(t6) {}
	void showBxandBasexfromOuterB() { CBase::showbasex(); showbx(); }
	void showByandBaseyfromOuterB() { CBase::showy(); showby(); }
	void showBzandBasezfromOuterB() { CBase::showz(); showbz(); }
};

class CDeriveC:public CBase
{
private:
	int cx;
	void showcx() { cout << "CDeriveC::cx=" << cx << endl; }
protected:
	int cy;
	void showcy() { cout << "CDeriveC::cy=" << cy << endl; }
public:
	int cz;
	void showcz() { cout << "CDeriveC::cz=" << cz << endl; }
	CDeriveC(int t1, int t2, int t3, int t4, int t5, int t6) :CBase(t1, t2, t3), cx(t4), cy(t5), cz(t6) {}
	void showCxandBasexfromOuterC() { CBase::showbasex(); showcx(); }
	void showCyandBaseyfromOuterC() { CBase::showy(); showcy(); }
	void showCzandBasezfromOuterC() { CBase::showz(); showcz(); }

};


void main() {
	CDeriveA ca(11, 12, 13, 14, 15, 16);
	ca.showAxandBasexfromOuterA();
	ca.showAyandBaseyfromOuterA();
	ca.showAzandBasezfromOuterA();


	CDeriveB cb(21, 22, 23, 24, 25, 26);
	cb.showBxandBasexfromOuterB();
	cb.showByandBaseyfromOuterB();
	cb.showBzandBasezfromOuterB();


	CDeriveC cc(31, 32, 33, 34, 35, 36);
	cc.showCxandBasexfromOuterC();
	cc.showCyandBaseyfromOuterC();
	cc.showCzandBasezfromOuterC();


}